package com;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Test {
    public static void main(String[] args) throws Exception {

        Class.forName("com.mysql.cj.jdbc.Driver");

        Connection conn = DriverManager.getConnection("jdbc:mysql:///studentmanager?useSSL=false&serverTimezone=UTC", "root", "root");
        PreparedStatement ps = conn.prepareStatement("select * from student");
        ResultSet res = ps.executeQuery();
        while(res.next()){
            System.out.println(res.getObject(1));
            System.out.println(res.getObject(2));
            System.out.println(res.getObject(3));
            System.out.println(res.getObject(4));

        }


    }
}
